﻿<?php

//ini_set("display_errors", "On");
//error_reporting(E_ALL | E_STRICT);
require_once "../system.back.php";
require_once '../tools/tools.common.php';
require_once '../system.UIShujuZhongxin.php';

if(isset($_POST['ok'])){
    $g管理员=new C后台管理员();
    $retu=$g管理员->fd登陆检验($_POST['user'],$_POST['password']);
    $url = G_SITE_BASE.'/admin/index.php?m=system_config';
    if($retu){
        header("Location:".$url);
    }else{
        echo "<script>alert('密码输入有误！');</script>";
    }
}
    $bm=new CUI数据中心(Page::m卖家中心_账目,'');

//@ $code=$_REQUEST['code'];
$state=null;
if(array_key_exists('state',$_REQUEST)) $state=$_REQUEST['state'];
$paramArray=false;

if($state){
    //某些页面要传多个参数时，需要通过state参数分解
    if(substr($state,0,3)=='000'){
        $enc=substr($state,3);
        logger()->logDebug2($enc);
        $paramArray=Tools::object2array(json_decode(urldecode($enc)));
        logger()->logDebug2($paramArray);

        $page = $paramArray[0];
    }else{
        $page=$state;
    }
    require $page.'.php';
    exit(0);
}

function getStr($str)  {
    echo '<div style="width:80%; height:50%; left:10%; top:10%; position:absolute; z-index: 10; background-color:#d0e9c6; display:block;font-size: 80px"><div style=" height:50%; color:#848484; width: 100%; text-align: center; margin-top: 25%">'.$str.'</div><div style="height:50%; width: 100%; text-align: center; margin-top: -15%"><input type="button"  style=" background-color: #5cb85c;border-color: #4cae4c;color: #fff;width: 50%; height: 50%;border-radius: 6px;font-size: 70px;line-height: 1.33;padding: 10px 16px;" onclick="closeWind()" value="关闭"></div></div>';
    $close = <<<EOT
<script>
function closeWind(){
        if(typeof(WeixinJSBridge)=='undefined'){
            window.close();
        }else
            WeixinJSBridge.invoke('closeWindow',{},function(res){
                //alert(res.err_msg);
                return true;
            });
    }
</script>
EOT;
    echo $close;
}
function PrintPageHead(){
    echo '    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <meta name="format-detection" content="telephone=no, address=no">
    <meta name="apple-mobile-web-app-capable" content="yes" /> <!-- apple devices fullscreen -->
    <meta name="apple-touch-fullscreen" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <meta name="keywords" content="微直达" />
    <meta name="description" content="微直达: 直达天下，瞬息联通。" />

    <!-- Bootstrap -->
    <link href="../resource/css/bootstrap.min.css" rel="stylesheet">
    <link href="../resource/css/common.css" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js does not work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    ';
}

function curl_get_contents($url,$timeout=3) {
    $curlHandle = curl_init();
    curl_setopt( $curlHandle , CURLOPT_URL, $url );
    curl_setopt( $curlHandle , CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt( $curlHandle , CURLOPT_TIMEOUT, $timeout );
    $result = curl_exec( $curlHandle );
    curl_close( $curlHandle );
    return $result;
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF8">
    <title>微直达-邻和科技</title>
    <style type="text/css">
        body {
            font-family: Arial, Helvetica, sans-serif;

            color: #000000;
            background-color: #FFFFFF;
            margin: 0;
            padding: 10px 20px 20px 20px;
            text-align:center;
        }

        hr {
            margin-left: 90px;
            height: 1px;
            color: #000000;
            background-color: #000000;
            border: none;
        }

        #logo {


            margin-bottom: 10px;
            margin-left: 28px;
        }

        .text {
            font-size: 40px;
            width: 80%;
            color: blue;
            margin-left: 90px;
            line-height: 140%;
        }
        .bodyDiv {
            height: 600px;
            width: 800px;
            border-color: #000;
            text-align:center;
        }

        body {
            font-family: Arial, Helvetica, sans-serif;

            color: #000000;
            background-color: #FFFFFF;
            margin: 0;
            padding: 10px 20px 20px 20px;
            text-align:center;
        }

        hr {
            margin-left: 90px;
            height: 1px;
            color: #000000;
            background-color: #000000;
            border: none;
        }

    </style>


</head>
<body>
<link rel="stylesheet" href="../resource/css/normalize.css">
<section class="login-form-wrap">
    <h1>后台管理</h1>
    <form class="login-form" method="post" action="">
        <label><input type="user" name="user" required placeholder="用户名"></label>
        <label><input type="password" name="password" required placeholder="密码"></label>
        <input type="submit" value="Login" name="ok">
    </form>

</section>

</body>
</html>